// 引入axios请求
import { ajax } from '@/utils/request'

// 组织架构信息请求
export const getDepartments = () => {
  return ajax({
    url: '/company/department'
  })
}
// 获取负责人请求
export const getEmployeeSimple = () => {
  return ajax({
    url: '/sys/user/simple'
  })
}
// 新增部门功能
export const addDepartments = data => {
  return ajax({
    url: '/company/department',
    method: 'POST',
    data
  })
}
// 删除部门
export const delDepartment = id => {
  return ajax({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
// 获取部门详情
export const getDepartDetail = id => {
  return ajax({
    url: `/company/department/${id}`
  })
}
// 更新部门详情
export const updateDepartments = (data) => {
  return ajax({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
